home *** CD-ROM | disk | FTP | other *** search
/ Champak 119 / (Vol 119) Nov 09 2010.iso / Games / tobby_ura_ura.swf / scripts / DefineSprite_79 / frame_1 / DoAction.as
Text File  |  2010-11-09  |  1KB  |  49 lines

  1. function main()
  2. {
  3.    if(this.entryFlg == true)
  4.    {
  5.       this.hitCheck();
  6.    }
  7.    if(this.getFlg == false)
  8.    {
  9.       this.stageY = this.py - _root.baseY;
  10.       this.stageX = this.px - _root.baseX;
  11.       if(this.stageX < 0 || 640 < this.stageX)
  12.       {
  13.          this.entryFlg = false;
  14.          this._visible = false;
  15.       }
  16.       else
  17.       {
  18.          this.entryFlg = true;
  19.          this._visible = true;
  20.       }
  21.    }
  22. }
  23. function hitCheck()
  24. {
  25.    if(this.hitTest(_root.tobbyMC) || this.hitTest(_root.handMC))
  26.    {
  27.       this.SE_kaito.start();
  28.       _root.getHosekiCnt = _root.getHosekiCnt + 1;
  29.       _root.getHosekiCntS = _root.getHosekiCntS + 1;
  30.       _root.gScore += 1048;
  31.       _root.numMainScoreMC.dispNum(_root.gScore);
  32.       this.entryFlg = false;
  33.       this.getFlg = true;
  34.       this.AnmMC.gotoAndPlay("kieru");
  35.    }
  36. }
  37. function unEntry()
  38. {
  39.    this._visible = false;
  40. }
  41. this.px = this._x;
  42. this.py = this._y;
  43. this.anmMC.gotoAndPlay(_root.randomInt(40));
  44. this._visible = false;
  45. this.entryFlg = false;
  46. this.getFlg = false;
  47. this.SE_kaito = new Sound(this);
  48. this.SE_kaito.attachSound("SE_kaito");
  49.